//package cn.good.yan.config;
//
//import lombok.Data;
//import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.amqp.rabbit.transaction.RabbitTransactionManager;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * 3 .MQ - 事务
// *
// * @author shengren.yan
// * @create 2024-06-17
// */
//@Configuration
//@Data
//public class RabbitConfig {
//
//    @Bean
//    public RabbitTransactionManager transactionManager(CachingConnectionFactory connectionFactory) {
//        return new RabbitTransactionManager(connectionFactory);
//    }
//
//    @Bean
//    public RabbitTemplate rabbitTemplate(CachingConnectionFactory connectionFactory) {
//        RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
//        rabbitTemplate.setChannelTransacted(true);
//        return rabbitTemplate;
//    }
//
//}
